#include <iostream>
using namespace std;
class CSingleton {
private:
	static CSingleton* pInstance;
	CSingleton();
public:
	static CSingleton* Instance();
	static void Destory();
};
CSingleton* CSingleton::pInstance = nullptr;
CSingleton::CSingleton(){
	cout << "Singleton..." << endl;
}
CSingleton* CSingleton::Instance() {
	if (pInstance == nullptr) {
		pInstance = new CSingleton();
	}
	return pInstance;
}
void CSingleton::Destory() {
	delete pInstance;
	pInstance = nullptr;
	cout << "Destory..."<<endl;
}
int main(int argc, char* argv[]) {
	CSingleton* a = CSingleton::Instance();
	CSingleton* b = CSingleton::Instance();
	CSingleton::Destory();
	CSingleton* c = CSingleton::Instance();
	return 0;
}